package com.fjnu.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.fjnu.dao.IBorrowDao;
import com.fjnu.entities.Borrow;
import com.fjnu.entities.User;
import com.fjnu.service.IBorrowService;
@Service
@Transactional(propagation=Propagation.REQUIRED)
public class BorrowService implements IBorrowService {
	@Autowired
	private IBorrowDao borrowDao;
	@Override
	public void addBorrow(Borrow borrow) {
		borrowDao.addBorrow(borrow);
	}

	@Override
	public void updateBorrow(Borrow borrow) {
		borrowDao.updateBorrow(borrow);
	}

	@Override
	public void delBorrow(Integer id) {
		borrowDao.delBorrow(id);
	}

	@Override
	public List<Borrow> findBorrowByBUser(User borrowUser) {
		return borrowDao.findBorrowByBUser(borrowUser);
	}

	@Override
	public List<Borrow> findBorrowForEUser(String status) {
		return borrowDao.findBorrowForEUser(status);
	}

	@Override
	public Borrow findUniqueBorrow(Integer id) {
	
		return borrowDao.findUniqueBorrow(id);
	}

}
